package com.itcncp.wechat.app.dao.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.itcncp.common.plugin.ToStringSerializer;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

public class UserAccountOpJnl implements Serializable {
    /**
     * 车道交易流水号
     *
     * @mbg.generated
     */
    private String transNo;

    /**
     * 账户id
     *
     * @mbg.generated
     */
    @JSONField(serializeUsing= ToStringSerializer.class)
    private Long userId;

    /**
     * 变动金额
     *
     * @mbg.generated
     */
    private BigDecimal changeBalance;

    /**
     * 原来余额
     *
     * @mbg.generated
     */
    private BigDecimal oldBalance;

    /**
     * 现有余额
     *
     * @mbg.generated
     */
    private BigDecimal nowBalance;

    /**
     * 交易时间
     *
     * @mbg.generated
     */
    private Date transTimestamp;

    /**
     * 摘要
     *
     * @mbg.generated
     */
    private String resume;

    private String remark;

    private static final long serialVersionUID = 1L;

    public String getTransNo() {
        return transNo;
    }

    public void setTransNo(String transNo) {
        this.transNo = transNo;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public BigDecimal getChangeBalance() {
        return changeBalance;
    }

    public void setChangeBalance(BigDecimal changeBalance) {
        this.changeBalance = changeBalance;
    }

    public BigDecimal getOldBalance() {
        return oldBalance;
    }

    public void setOldBalance(BigDecimal oldBalance) {
        this.oldBalance = oldBalance;
    }

    public BigDecimal getNowBalance() {
        return nowBalance;
    }

    public void setNowBalance(BigDecimal nowBalance) {
        this.nowBalance = nowBalance;
    }

    public Date getTransTimestamp() {
        return transTimestamp;
    }

    public void setTransTimestamp(Date transTimestamp) {
        this.transTimestamp = transTimestamp;
    }

    public String getResume() {
        return resume;
    }

    public void setResume(String resume) {
        this.resume = resume;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", transNo=").append(transNo);
        sb.append(", userId=").append(userId);
        sb.append(", changeBalance=").append(changeBalance);
        sb.append(", oldBalance=").append(oldBalance);
        sb.append(", nowBalance=").append(nowBalance);
        sb.append(", transTimestamp=").append(transTimestamp);
        sb.append(", resume=").append(resume);
        sb.append(", remark=").append(remark);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserAccountOpJnl other = (UserAccountOpJnl) that;
        return (this.getTransNo() == null ? other.getTransNo() == null : this.getTransNo().equals(other.getTransNo()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getChangeBalance() == null ? other.getChangeBalance() == null : this.getChangeBalance().equals(other.getChangeBalance()))
            && (this.getOldBalance() == null ? other.getOldBalance() == null : this.getOldBalance().equals(other.getOldBalance()))
            && (this.getNowBalance() == null ? other.getNowBalance() == null : this.getNowBalance().equals(other.getNowBalance()))
            && (this.getTransTimestamp() == null ? other.getTransTimestamp() == null : this.getTransTimestamp().equals(other.getTransTimestamp()))
            && (this.getResume() == null ? other.getResume() == null : this.getResume().equals(other.getResume()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTransNo() == null) ? 0 : getTransNo().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getChangeBalance() == null) ? 0 : getChangeBalance().hashCode());
        result = prime * result + ((getOldBalance() == null) ? 0 : getOldBalance().hashCode());
        result = prime * result + ((getNowBalance() == null) ? 0 : getNowBalance().hashCode());
        result = prime * result + ((getTransTimestamp() == null) ? 0 : getTransTimestamp().hashCode());
        result = prime * result + ((getResume() == null) ? 0 : getResume().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }
}